import { createApp } from 'vue'
import { createPinia } from 'pinia' // 凤梨
// 引入vue组件库 70%的组件有组件库提供了
import * as ElementPlusIconsVue from '@element-plus/icons-vue'
// * as 引入所有组件库
// console.log(ElementPlusIconsVue);
// import * as DemoData from './test'
// import Data ,{a} from './test'
// console.log(DemoData);

import { 
    ElButton,
    ElForm,
    ElFormItem,
    ElInput,
    ElCheckbox,
    ElLink,
    ElIcon,
} from 'element-plus'
// 组件库依赖的样式
import 'element-plus/dist/index.css'
import router from './router'


import App from './App.vue'
const app = createApp(App)

//object.entries 将数据以 [key, component] 二维数组的形式返回
for (const [key, component] of Object.entries(ElementPlusIconsVue)){
    app.component(key, component)  // 全局注册所有组件库提供的组件
    // app.component(key, () => import(`element-plus/lib/components/${key}`))  // 按需引入
}

app
.use(createPinia())
.use(ElIcon)
.use(router)
.use(ElButton)
.use(ElForm)
.use(ElFormItem)
.use(ElInput)
.use(ElCheckbox)
.use(ElLink)
.mount('#app')

